#!/bin/bash
cd ..
dist_dir=$(pwd)/dist
hc_cache_dir=${dist_dir}/hc-cache
tar_file=hc-cache.tar.gz

echo "开始打包..."
rm -rf ${hc_cache_dir}
mkdir -p ${hc_cache_dir}
mkdir -p ${hc_cache_dir}/nmon
mkdir -p ${hc_cache_dir}/bin
mkdir -p ${hc_cache_dir}/data
mkdir -p ${hc_cache_dir}/config
mkdir -p ${hc_cache_dir}/logs
mkdir -p ${hc_cache_dir}/redis
cp ./script/hc-cache-init.sh ${hc_cache_dir}/bin/
cp ./hc-cache-web/nmon/* ${hc_cache_dir}/nmon/
chmod 755 ${hc_cache_dir}/logs
chmod 755 ${hc_cache_dir}/bin/*.sh
chmod 755 ${hc_cache_dir}/nmon/*
cd ${dist_dir} && rm -rf ${tar_file} && tar -zcvf ${tar_file} ./hc-cache
echo "完成..."
